home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / x2ftp / msdos / source / gor_flag / gor_flag.asm < prev    next >
Encoding:
Assembly Source File  |  1995-02-03  |  20.0 KB  |  625 lines

  1. ;-------------------------------------------------------------------------------
  2. ;                  Sinus Flag Tester
  3. ;-------------------------------------------------------------------------------
  4. ;              Copyright (C) 1994 The Corporation
  5. ;-------------------------------------------------------------------------------
  6. ;                        code: Gor
  7. ;-------------------------------------------------------------------------------
  8. ; email me at : gearyp@cs.man.ac.uk
  9.  
  10. BORDERS=1                             ;set to 1 for visible border-timings
  11.  
  12. code     SEGMENT para public 'CODE'
  13.     ASSUME cs:code
  14.     LOCALS
  15.     .386
  16.  
  17. ORG    100h
  18. start:
  19.     jmp    main
  20.  
  21. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ setborder ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  22. ;descr: debug/change border color
  23. setborder MACRO col
  24.     IF BORDERS
  25.     push    ax
  26.     push    dx
  27.     mov    dx,3dah                  ;STATUS REGISTER-ONE
  28.     in    al,dx                    ;set attribute reg. to address mode
  29.     mov    dx,3c0h                  ;ATTRIBUTE CONTROL REGISTER
  30.     mov    al,11h+32
  31.     out    dx,al                    ;get Overscan colour register
  32.     mov    al,col                   ;get col
  33.     out    dx,al                    ;use col as border retrace colour
  34.     pop    dx
  35.     pop    ax
  36.     ENDIF
  37.     ENDM
  38.  
  39. ;███████████████ Intro Routines ████████████████████
  40.  
  41. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ timer ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  42. inittimer PROC NEAR
  43.     mov    eax,fs:[8*4]                    ;get old timer address
  44.     mov    ds:oldint8,eax                  ;store it
  45.     mov    ax,cs
  46.     shl    eax,16
  47.     mov    ax,OFFSET intti8                ;get my interrupt routine
  48.     mov    dx,17000 ;70hz
  49.     jmp    @@1
  50. deinittimer:
  51.     mov    eax,ds:oldint8                  ;get old interrupt
  52.     xor    dx,dx
  53. @@1:    cli                                     ;clear interrupts
  54.     mov    fs:[8*4],eax                    ;patch in my interrupt
  55.     mov    al,036h
  56.     out    43h,al
  57.     mov    al,dl
  58.     out    40h,al
  59.     mov    al,dh
  60.     out    40h,al
  61.     sti
  62.     ret
  63. inittimer ENDP
  64.  
  65. intti8    PROC FAR ;timer interrupt
  66.     push    ax
  67.     mov    al,20h
  68.     out    20h,al
  69.     inc    cs:framecounter
  70.     pop    ax
  71.     iret
  72. intti8    ENDP
  73.  
  74. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ load indexed palette ▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  75. setpal    PROC NEAR
  76.     ;ds:si=pointer to colorindices
  77.     mov    dx,3c8h                         ;PEL address write mode
  78.     xor    al,al                           ;clear al
  79.     out    dx,al                           ;select data register zero
  80.     inc    dx                              ;next data register
  81.     mov    cx,8                            ;
  82. @@1:    xor    bh,bh
  83.     mov    bl,ds:[si]
  84.     shr    bl,2
  85.     call    setpl2                          ;write cols
  86.     mov    bl,ds:[si]
  87.     shl    bx,2
  88.     call    setpl2                          ;write cols
  89.     inc    si
  90.     loop    @@1
  91.     ret
  92.  
  93. setpl2:    and    bx,15*2                         ;limit offset
  94.     mov    ax,word ptr ds:col0[bx]         ;get colour 1+2
  95.     out    dx,al                           ;write col RED
  96.     mov    al,ah                           ;get high-byte
  97.     out    dx,al                           ;write col GREEN
  98.     mov    al,ds:col0[bx+2]                ;get colour 3
  99.     out    dx,al                           ;write col BLUE
  100.     ret
  101. setpal    ENDP
  102.  
  103. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒ clear & copy videobuffer to screen ▒▒▒▒▒▒▒▒▒▒▒▒▒▒
  104. clearcopy PROC NEAR
  105.  
  106.     xor    edx,edx                         ;clear reg
  107.     mov    si,OFFSET vbuf                  ;get vbuffer
  108.     mov    bx,4                            ;4 bytes at a time!
  109.     mov    cx,200                          ;loop counter
  110.     mov    di,-4                           ;vram row-offest
  111. @@1:    mov    bp,5
  112. @@2:    REPT    2
  113.     mov    eax,ds:[si]                     ;get 4 bytes from vbuffer
  114.     add    di,bx
  115.     mov    ds:[si],edx                     ;clear 4 bytes of vbuffer
  116.     add    si,bx                           ;next 4 bytes to read
  117.     mov    es:[di],eax                     ;copy buffer to vram
  118.     ENDM                                    ;moved 8 bytes so far...
  119.     dec    bp
  120.     jnz    @@2                             ;move 40 bytes (1 scan line!)
  121.     add    si,bx                           ;next scan-line
  122.     dec    cx
  123.     jnz    @@1                             ;all 200 scan-lines to copy...
  124.     ret
  125. clearcopy ENDP
  126.  
  127. ;▒▒▒▒▒▒▒▒▒▒▒▒▒▒ advance demo one frame (raw work) ▒▒▒▒▒▒▒▒▒▒▒▒▒
  128.  
  129. doit    PROC NEAR
  130.  
  131. ;====== WAIT FOR VSYNC =========================================================
  132.  
  133.     setborder 0
  134.     mov    dx,3dah                         ;get STATUS REGISTER ONE
  135. @@w1:    in    al,dx
  136.     test    al,8                            ;is screen in vertical retrace ?
  137.     jnz    @@w1                            ;wait for non-retrace
  138. @@w2:    in    al,dx
  139.     test    al,8                            ;is screen at start of retrace ?
  140.     jz    @@w2                            ;wait for beginning of retrace
  141.     setborder 30
  142.  
  143. ; NOTE: Why are there two wait loops ?
  144. ; The retrace status indicates only that the vertical retrace is in progress;
  145. ; it may be almost finished when you first check. To get around this you need
  146. ; to first wait for a display interval and then wait for the vertical retrace.
  147.  
  148.  
  149. ;====== SET NEW PALETTE ========================================================
  150.  
  151.     mov    si,ds:index                     ;get palette pointer
  152.     push    si
  153.     call    setpal                          ;set new palette
  154.     pop    si
  155.     add    si,9                            ;next palette
  156.     cmp    si,OFFSET index4                ;check for end of palette list
  157.     jbe    @@i2                            ;if less, no change
  158.     mov    si,OFFSET index1                ;otherwise, reset pointer
  159.  
  160. ;====== SET BITPLANE TO USE ====================================================
  161.  
  162. @@i2:    mov    ds:index,si                     ;and store
  163.     mov    al,2                            ;index number of the Map Mask Register
  164.     mov    ah,ds:[si+8]                    ;get bitplane to write in vblank
  165.     mov    dx,3c4h                         ;SEQUENCER ADDRESS REGISTER
  166.     out    dx,ax                           ;select bitplane to modify
  167.     call    clearcopy                       ;copy buffer to vram
  168.  
  169. ; NOTE: The Sequencer Address Register selects which register will appear at
  170. ; port 3c5h. The index number of the desired register is written to port 3c5h.
  171.  
  172. ; The Map Mask Register enables or disables the specified bit planes during
  173. ; a memory write. Each bit set will allow that plane to be modified;, e.g.,
  174. ; setting bits 1 and 3 allows cpu to write data to bit planes 1 and 3.
  175.  
  176. ; When using odd/even modes, bits 0 and 1, and 2 and 3 should have the same
  177. ; value. When using Chain 4 mode, all four maps should be set the same.
  178.  
  179. ; This register affects all write modes; i.e., all data written to adapter
  180. ; memory.
  181.  
  182. ; Bits:         0 = bitplane 0
  183. ;               1 = bitplane 1
  184. ;               2 = bitplane 2
  185. ;               3 = bitplane 3
  186. ;               4-7 not used
  187.  
  188. ;====== DO TIMER STUFF =========================================================
  189.  
  190.     setborder 26                            ;is running correct
  191. @@78:
  192.         add     SinX,12                         ;increment sine-x
  193.         sub     SinY,20                         ;increment sine-y
  194.         and     SinX,2047                       ;limit to data-size
  195.         and     SinY,2047                       ;limit to data-size
  196.         mov     ax,SinX                         ;get sine-x
  197.         mov     bx,SinY                         ;get sine-y
  198.         mov     cx,216                          ;x-axis start-pos
  199.         mov     dx,180                          ;y-axis start-pos
  200. NxtPnt:
  201.         push    cx                              ;store current x/y pos.
  202.         push    dx
  203.  
  204.         add     cx,52
  205.         add     dx,35
  206.         and     ax,2047                         ;limit sine-offset-x
  207.         and     bx,2047                         ;limit sine-offset-y
  208.  
  209.         mov     si,ax
  210.         add     cx,ds:Sine[si]                  ;add x-axis offset
  211.         add     dx,ds:Sine[bx]                  ;add y-axis offset
  212.  
  213.         mov     si,cx
  214.         mov     di,dx
  215.  
  216.         cmp     si,319
  217.         ja      Nxt
  218.         cmp     di,199
  219.         ja      Nxt
  220.  
  221.         add     si,si                           ;x2
  222.         add     di,di                           ;x2
  223.  
  224.         mov     dx,ds:rows[di]
  225.         add     dx,ds:cols[si]
  226.         mov     di,dx
  227.  
  228.         push    ax
  229.         mov     al,ds:colb[si]                  ;get pixel from table
  230.         or      ds:[di],al                      ;plot pixel
  231.         pop     ax
  232. Nxt:
  233.         add     ax,20
  234.         add     bx,32
  235.  
  236.         pop     dx                              ;get current x/y pos.
  237.         pop     cx
  238.  
  239.         sub     cx,8                            ;next pos (27 pixels)
  240.         jnz     NxtPnt                          ;plot 1 line of pixels
  241.         mov     cx,216                          ;reset x-axis
  242.         sub     ax,500                          ;modify sine-offset-x
  243.         sub     bx,1050                         ;modify sine-offset-y
  244.         sub     dx,6                            ;next row of pixels (
  245.         jnz     NxtPnt
  246.     ret
  247.  
  248. doit    ENDP
  249.  
  250.  
  251. ;████████████████ Main routine █████████████████████████████████████████████████
  252. ;stack @ cs:0fffeh
  253.  
  254. main    PROC NEAR
  255. ;═════════ Init Segs ═══════════════════════════════════════════════════════════
  256. .8086
  257.     push    cs
  258.     push    cs
  259.     pop    ds
  260.     pop    es
  261.     xor    ax,ax                           ;zero used later
  262.     mov    dx,0a000h                       ;vram address
  263.     mov    es,dx                           ;es now points to vram
  264. ;segments now set: DS=code/data ES=vram
  265. ;═════════ Check for 386 ═══════════════════════════════════════════════════════
  266.     push    sp                              ;test order of write/decrement
  267.     pop    dx                              ;by PUSH SP
  268.     cmp    dx,sp                           ;if dx=sp, cpu not 80186/80188
  269.     jz    @@o1
  270. @@o2:    jmp    endansi                         ;80(1)86 found so exit
  271. .286p
  272. @@o1:    mov    bx,OFFSET rows
  273.     sgdt    ds:[bx]
  274.     cmp    byte ptr ds:[bx+5],0
  275.     js    @@o2                            ;80(2)86 found so exit
  276. ;═════════ Check for VGA ═══════════════════════════════════════════════════════
  277. .386p
  278.     mov    fs,ax                           ;ax was zero, fs=zeropage
  279.  
  280. ;segments now set: DS=code/data ES=vram FS=zeropage
  281.  
  282.     mov    ax,1a00h                        ;Function:
  283.     int    10h                             ;READ DISPLAY COMBINATION
  284.     cmp    al,01ah                         ;1ah indicates vga connected
  285.     jne    endansi                         ;otherwise - forget it..
  286.     cmp    bl,7                            ;check 2nd display for vga
  287.     jb    endansi                         ;any less and it's not
  288.  
  289. ;═════════ Initialize - vga ════════════════════════════════════════════════════
  290.  
  291.     mov    ax,0dh                          ;Function: vga 16 col 320x200
  292.     int    10h                             ;SET VIDEO STATE
  293.  
  294.     ;set up rows/cols/etc
  295.  
  296.     mov    si,-2                           ;buffer-offset
  297.     mov    di,OFFSET vbuf-44               ;vram buffer-pointer
  298.     mov    bl,128
  299.     xor    bp,bp                           ;reset columns-offset
  300.     jmp    @@b4
  301. @@b1:    mov    ds:rows[si],di                  ;store row-offset
  302.     mov    ds:colb[si],bl                  ;store pixel-gfx
  303.     mov    ds:cols[si],bp                  ;store columns-offset
  304.     ror    bl,1                            ;rotate pixel right
  305.     jnc    @@b4                            ;shift 8 times
  306.     inc    bp                              ;next column
  307. @@b4:    add    di,44                           ;next row-offset
  308.     add    si,2                            ;next pos in buffer
  309.     cmp    si,(320)*2                      ;check for last column
  310.     jle    @@b1                            ;jump if less-than..
  311.  
  312.     ;set simplex palette order (16 color mode)
  313.  
  314.     mov    dx,3dah
  315.     in    al,dx
  316.     mov    dl,0c0h
  317.     xor    ax,ax
  318.     mov    cx,16
  319. @@b2:    out    dx,al
  320.     out    dx,al
  321.     inc    al
  322.     loop    @@b2
  323.     mov    al,20h
  324.     out    dx,al
  325. ;═════════ Initialize - others ═════════
  326.     call    inittimer
  327. ;═════════ Do the intro stuff ═════════
  328. again:    call    doit                            ;run main routines
  329.     mov    ah,1
  330.     int    16h                             ;read keystroke buffer
  331.     jz    again                           ;if nothing there, keep looping
  332.     mov    ah,0
  333.     int    16h
  334. ;═════════ DeInitialize ═════════
  335.     call    deinittimer
  336. ;═════════ Display end ansi (only thing done if no 386 or vga) ═════════
  337. endansi:mov    ax,3h
  338.     int    10h
  339.     mov    si,OFFSET endtext
  340.     push    0b800h                            ;if the user has an MGA or HGC
  341.     pop    es                            ;it's not my problem :-)
  342.     xor    di,di
  343.     mov    ah,0eh
  344. @@1:    lodsb
  345.     IFDEF XORTEXTS
  346.     xor    al,17h
  347.     ENDIF
  348.     cmp    al,31
  349.     jae    @@2
  350.     mov    ah,al
  351.     jmp    @@1
  352. @@2:    jz    @@3
  353.     stosw
  354.     jmp    @@1
  355. @@3:    mov    ax,4c00h
  356.     int    21h
  357. main    ENDP
  358.  
  359. ;████████████████ Initialized (nonzero) data ████████████████
  360.  
  361. udforced LABEL DWORD
  362.  
  363. col0    db     0, 0, 0 ,0    ;background color
  364. col1    db     5,5,5 ,0    ;delay color 3
  365. col2    db    10,10,10 ,0    ;delay color 2
  366. col3    db    30,30,30 ,0    ;delay color 1
  367. col4    db    60,60,60     ;brightest color
  368.     ;1    . x . x . x . x . x . x . x . x
  369.     ;2    . . x x . . x x . . x x . . x x
  370.     ;4    . . . . x x x x . . . . x x x x
  371.     ;8    . . . . . . . . x x x x x x x x
  372. ;palette indices for 4 palettes. Last number is bitplane to write
  373. ;during the frame having this palette
  374. index1    db    04h,34h,24h,34h,14h,34h,24h,34h    ,1 ;1248
  375. index2    db    03h,23h,13h,23h,44h,44h,44h,44h    ,8 ;8124
  376. index3    db    02h,12h,44h,44h,33h,33h,44h,44h    ,4 ;4812
  377. index4    db    01h,44h,33h,44h,22h,44h,33h,44h    ,2 ;2481
  378. index    dw    OFFSET index1                      ;offset to current index
  379.  
  380. ;#########################################################
  381. SinX    dw      0
  382. SinY    dw      0
  383. Sine    dw    00h,00h,00h,01h,01h
  384.     dw    01h,01h,01h,02h,02h
  385.     dw    02h,02h,02h,03h,03h
  386.     dw    03h,03h,03h,04h,04h
  387.     dw    04h,04h,04h,05h,05h
  388.     dw    05h,05h,05h,05h,06h
  389.     dw    06h,06h,06h,06h,07h
  390.     dw    07h,07h,07h,07h,08h
  391.     dw    08h,08h,08h,08h,09h
  392.     dw    09h,09h,09h,09h,09h
  393.     dw    0Ah,0Ah,0Ah,0Ah,0Ah
  394.     dw    0Bh,0Bh,0Bh,0Bh,0Bh
  395.     dw    0Ch,0Ch,0Ch,0Ch,0Ch
  396.     dw    0Ch,0Dh,0Dh,0Dh,0Dh
  397.     dw    0Dh,0Eh,0Eh,0Eh,0Eh
  398.     dw    0Eh,0Eh,0Fh,0Fh,0Fh
  399.     dw    0Fh,0Fh,0Fh,10h,10h
  400.     dw    10h,10h,10h,10h,11h
  401.     dw    11h,11h,11h,11h,11h
  402.     dw    12h,12h,12h,12h,12h
  403.     dw    12h,13h,13h,13h,13h
  404.     dw    13h,13h,14h,14h,14h
  405.     dw    14h,14h,14h,14h,15h
  406.     dw    15h,15h,15h,15h,15h
  407.     dw    15h,16h,16h,16h,16h
  408.     dw    16h,16h,16h,17h,17h
  409.     dw    17h,17h,17h,17h,17h
  410.     dw    18h,18h,18h,18h,18h
  411.     dw    18h,18h,18h,19h,19h
  412.     dw    19h,19h,19h,19h,19h
  413.     dw    19h,1Ah,1Ah,1Ah,1Ah
  414.     dw    1Ah,1Ah,1Ah,1Ah,1Ah
  415.     dw    1Bh,1Bh,1Bh,1Bh,1Bh
  416.     dw    1Bh,1Bh,1Bh,1Bh,1Ch
  417.     dw    1Ch,1Ch,1Ch,1Ch,1Ch
  418.     dw    1Ch,1Ch,1Ch,1Ch,1Ch
  419.     dw    1Dh,1Dh,1Dh,1Dh,1Dh
  420.     dw    1Dh,1Dh,1Dh,1Dh,1Dh
  421.     dw    1Dh,1Dh,1Eh,1Eh,1Eh
  422.     dw    1Eh,1Eh,1Eh,1Eh,1Eh
  423.     dw    1Eh,1Eh,1Eh,1Eh,1Eh
  424.     dw    1Eh,1Fh,1Fh,1Fh,1Fh
  425.     dw    1Fh,1Fh,1Fh,1Fh,1Fh
  426.     dw    1Fh,1Fh,1Fh,1Fh,1Fh
  427.     dw    1Fh,1Fh,1Fh,1Fh,1Fh
  428.     dw    1Fh,1Fh,1Fh,20h,20h
  429.     dw    20h,20h,20h,20h,20h
  430.     dw    20h,20h,20h,20h,20h
  431.     dw    20h,20h,20h,20h,20h
  432.     dw    20h,20h,20h,20h,20h
  433.     dw    20h,20h,20h,20h,20h
  434.     dw    20h,20h,20h,20h,20h
  435.     dw    20h,20h,20h,20h,20h
  436.     dw    20h,20h,20h,20h,20h
  437.     dw    20h,20h,20h,20h,20h
  438.     dw    20h,20h,20h,20h,20h
  439.     dw    20h,20h,20h,20h,20h
  440.     dw    1Fh,1Fh,1Fh,1Fh,1Fh
  441.     dw    1Fh,1Fh,1Fh,1Fh,1Fh
  442.     dw    1Fh,1Fh,1Fh,1Fh,1Fh
  443.     dw    1Fh,1Fh,1Fh,1Fh,1Fh
  444.     dw    1Fh,1Fh,1Eh,1Eh,1Eh
  445.     dw    1Eh,1Eh,1Eh,1Eh,1Eh
  446.     dw    1Eh,1Eh,1Eh,1Eh,1Eh
  447.     dw    1Eh,1Dh,1Dh,1Dh,1Dh
  448.     dw    1Dh,1Dh,1Dh,1Dh,1Dh
  449.     dw    1Dh,1Dh,1Dh,1Ch,1Ch
  450.     dw    1Ch,1Ch,1Ch,1Ch,1Ch
  451.     dw    1Ch,1Ch,1Ch,1Ch,1Bh
  452.     dw    1Bh,1Bh,1Bh,1Bh,1Bh
  453.     dw    1Bh,1Bh,1Bh,1Ah,1Ah
  454.     dw    1Ah,1Ah,1Ah,1Ah,1Ah
  455.     dw    1Ah,1Ah,19h,19h,19h
  456.     dw    19h,19h,19h,19h,19h
  457.     dw    18h,18h,18h,18h,18h
  458.     dw    18h,18h,18h,17h,17h
  459.     dw    17h,17h,17h,17h,17h
  460.     dw    16h,16h,16h,16h,16h
  461.     dw    16h,16h,15h,15h,15h
  462.     dw    15h,15h,15h,15h,14h
  463.     dw    14h,14h,14h,14h,14h
  464.     dw    14h,13h,13h,13h,13h
  465.     dw    13h,13h,12h,12h,12h
  466.     dw    12h,12h,12h,11h,11h
  467.     dw    11h,11h,11h,11h,10h
  468.     dw    10h,10h,10h,10h,10h
  469.     dw    0Fh,0Fh,0Fh,0Fh,0Fh
  470.     dw    0Fh,0Eh,0Eh,0Eh,0Eh
  471.     dw    0Eh,0Eh,0Dh,0Dh,0Dh
  472.     dw    0Dh,0Dh,0Ch,0Ch,0Ch
  473.     dw    0Ch,0Ch,0Ch,0Bh,0Bh
  474.     dw    0Bh,0Bh,0Bh,0Ah,0Ah
  475.     dw    0Ah,0Ah,0Ah,09h,09h
  476.     dw    09h,09h,09h,09h,08h
  477.     dw    08h,08h,08h,08h,07h
  478.     dw    07h,07h,07h,07h,06h
  479.     dw    06h,06h,06h,06h,05h
  480.     dw    05h,05h,05h,05h,05h
  481.     dw    04h,04h,04h,04h,04h
  482.     dw    03h,03h,03h,03h,03h
  483.     dw    02h,02h,02h,02h,02h
  484.     dw    01h,01h,01h,01h,01h
  485.     dw    00h,00h,00h,00h,00h
  486.     dw    00h,00h,00h,0FFFFh,0FFFFh
  487.     dw    0FFFFh,0FFFFh,0FFFFh,0FFFEh,0FFFEh
  488.     dw    0FFFEh,0FFFEh,0FFFEh,0FFFDh,0FFFDh
  489.     dw    0FFFDh,0FFFDh,0FFFDh,0FFFCh,0FFFCh
  490.     dw    0FFFCh,0FFFCh,0FFFCh,0FFFBh,0FFFBh
  491.     dw    0FFFBh,0FFFBh,0FFFBh,0FFFAh,0FFFAh
  492.     dw    0FFFAh,0FFFAh,0FFFAh,0FFF9h,0FFF9h
  493.     dw    0FFF9h,0FFF9h,0FFF9h,0FFF9h,0FFF8h
  494.     dw    0FFF8h,0FFF8h,0FFF8h,0FFF8h,0FFF7h
  495.     dw    0FFF7h,0FFF7h,0FFF7h,0FFF7h,0FFF6h
  496.     dw    0FFF6h,0FFF6h,0FFF6h,0FFF6h,0FFF6h
  497.     dw    0FFF5h,0FFF5h,0FFF5h,0FFF5h,0FFF5h
  498.     dw    0FFF4h,0FFF4h,0FFF4h,0FFF4h,0FFF4h
  499.     dw    0FFF4h,0FFF3h,0FFF3h,0FFF3h,0FFF3h
  500.     dw    0FFF3h,0FFF2h,0FFF2h,0FFF2h,0FFF2h
  501.     dw    0FFF2h,0FFF2h,0FFF1h,0FFF1h,0FFF1h
  502.     dw    0FFF1h,0FFF1h,0FFF1h,0FFF0h,0FFF0h
  503.     dw    0FFF0h,0FFF0h,0FFF0h,0FFF0h,0FFEFh
  504.     dw    0FFEFh,0FFEFh,0FFEFh,0FFEFh,0FFEFh
  505.     dw    0FFEEh,0FFEEh,0FFEEh,0FFEEh,0FFEEh
  506.     dw    0FFEEh,0FFEDh,0FFEDh,0FFEDh,0FFEDh
  507.     dw    0FFEDh,0FFEDh,0FFEDh,0FFECh,0FFECh
  508.     dw    0FFECh,0FFECh,0FFECh,0FFECh,0FFEBh
  509.     dw    0FFEBh,0FFEBh,0FFEBh,0FFEBh,0FFEBh
  510.     dw    0FFEBh,0FFEAh,0FFEAh,0FFEAh,0FFEAh
  511.     dw    0FFEAh,0FFEAh,0FFEAh,0FFE9h,0FFE9h
  512.     dw    0FFE9h,0FFE9h,0FFE9h,0FFE9h,0FFE9h
  513.     dw    0FFE9h,0FFE8h,0FFE8h,0FFE8h,0FFE8h
  514.     dw    0FFE8h,0FFE8h,0FFE8h,0FFE8h,0FFE7h
  515.     dw    0FFE7h,0FFE7h,0FFE7h,0FFE7h,0FFE7h
  516.     dw    0FFE7h,0FFE7h,0FFE6h,0FFE6h,0FFE6h
  517.     dw    0FFE6h,0FFE6h,0FFE6h,0FFE6h,0FFE6h
  518.     dw    0FFE6h,0FFE5h,0FFE5h,0FFE5h,0FFE5h
  519.     dw    0FFE5h,0FFE5h,0FFE5h,0FFE5h,0FFE5h
  520.     dw    0FFE5h,0FFE4h,0FFE4h,0FFE4h,0FFE4h
  521.     dw    0FFE4h,0FFE4h,0FFE4h,0FFE4h,0FFE4h
  522.     dw    0FFE4h,0FFE4h,0FFE3h,0FFE3h,0FFE3h
  523.     dw    0FFE3h,0FFE3h,0FFE3h,0FFE3h,0FFE3h
  524.     dw    0FFE3h,0FFE3h,0FFE3h,0FFE3h,0FFE3h
  525.     dw    0FFE3h,0FFE2h,0FFE2h,0FFE2h,0FFE2h
  526.     dw    0FFE2h,0FFE2h,0FFE2h,0FFE2h,0FFE2h
  527.     dw    0FFE2h,0FFE2h,0FFE2h,0FFE2h,0FFE2h
  528.     dw    0FFE2h,0FFE2h,0FFE2h,0FFE1h,0FFE1h
  529.     dw    0FFE1h,0FFE1h,0FFE1h,0FFE1h,0FFE1h
  530.     dw    0FFE1h,0FFE1h,0FFE1h,0FFE1h,0FFE1h
  531.     dw    0FFE1h,0FFE1h,0FFE1h,0FFE1h,0FFE1h
  532.     dw    0FFE1h,0FFE1h,0FFE1h,0FFE1h,0FFE1h
  533.     dw    0FFE1h,0FFE1h,0FFE1h,0FFE1h,0FFE1h
  534.     dw    0FFE1h,0FFE1h,0FFE1h,0FFE1h,0FFE1h
  535.     dw    0FFE1h,0FFE1h,0FFE1h,0FFE1h,0FFE1h
  536.     dw    0FFE1h,0FFE1h,0FFE1h,0FFE0h,0FFE1h
  537.     dw    0FFE1h,0FFE1h,0FFE1h,0FFE1h,0FFE1h
  538.     dw    0FFE1h,0FFE1h,0FFE1h,0FFE1h,0FFE1h
  539.     dw    0FFE1h,0FFE1h,0FFE1h,0FFE1h,0FFE1h
  540.     dw    0FFE1h,0FFE1h,0FFE1h,0FFE1h,0FFE1h
  541.     dw    0FFE1h,0FFE1h,0FFE1h,0FFE1h,0FFE1h
  542.     dw    0FFE1h,0FFE1h,0FFE1h,0FFE1h,0FFE1h
  543.     dw    0FFE1h,0FFE1h,0FFE1h,0FFE1h,0FFE1h
  544.     dw    0FFE1h,0FFE1h,0FFE1h,0FFE1h,0FFE2h
  545.     dw    0FFE2h,0FFE2h,0FFE2h,0FFE2h,0FFE2h
  546.     dw    0FFE2h,0FFE2h,0FFE2h,0FFE2h,0FFE2h
  547.     dw    0FFE2h,0FFE2h,0FFE2h,0FFE2h,0FFE2h
  548.     dw    0FFE2h,0FFE3h,0FFE3h,0FFE3h,0FFE3h
  549.     dw    0FFE3h,0FFE3h,0FFE3h,0FFE3h,0FFE3h
  550.     dw    0FFE3h,0FFE3h,0FFE3h,0FFE3h,0FFE3h
  551.     dw    0FFE4h,0FFE4h,0FFE4h,0FFE4h,0FFE4h
  552.     dw    0FFE4h,0FFE4h,0FFE4h,0FFE4h,0FFE4h
  553.     dw    0FFE4h,0FFE5h,0FFE5h,0FFE5h,0FFE5h
  554.     dw    0FFE5h,0FFE5h,0FFE5h,0FFE5h,0FFE5h
  555.     dw    0FFE5h,0FFE6h,0FFE6h,0FFE6h,0FFE6h
  556.     dw    0FFE6h,0FFE6h,0FFE6h,0FFE6h,0FFE6h
  557.     dw    0FFE7h,0FFE7h,0FFE7h,0FFE7h,0FFE7h
  558.     dw    0FFE7h,0FFE7h,0FFE7h,0FFE8h,0FFE8h
  559.     dw    0FFE8h,0FFE8h,0FFE8h,0FFE8h,0FFE8h
  560.     dw    0FFE8h,0FFE9h,0FFE9h,0FFE9h,0FFE9h
  561.     dw    0FFE9h,0FFE9h,0FFE9h,0FFE9h,0FFEAh
  562.     dw    0FFEAh,0FFEAh,0FFEAh,0FFEAh,0FFEAh
  563.     dw    0FFEAh,0FFEBh,0FFEBh,0FFEBh,0FFEBh
  564.     dw    0FFEBh,0FFEBh,0FFEBh,0FFECh,0FFECh
  565.     dw    0FFECh,0FFECh,0FFECh,0FFECh,0FFEDh
  566.     dw    0FFEDh,0FFEDh,0FFEDh,0FFEDh,0FFEDh
  567.     dw    0FFEDh,0FFEEh,0FFEEh,0FFEEh,0FFEEh
  568.     dw    0FFEEh,0FFEEh,0FFEFh,0FFEFh,0FFEFh
  569.     dw    0FFEFh,0FFEFh,0FFEFh,0FFF0h,0FFF0h
  570.     dw    0FFF0h,0FFF0h,0FFF0h,0FFF0h,0FFF1h
  571.     dw    0FFF1h,0FFF1h,0FFF1h,0FFF1h,0FFF1h
  572.     dw    0FFF2h,0FFF2h,0FFF2h,0FFF2h,0FFF2h
  573.     dw    0FFF2h,0FFF3h,0FFF3h,0FFF3h,0FFF3h
  574.     dw    0FFF3h,0FFF4h,0FFF4h,0FFF4h,0FFF4h
  575.     dw    0FFF4h,0FFF4h,0FFF5h,0FFF5h,0FFF5h
  576.     dw    0FFF5h,0FFF5h,0FFF6h,0FFF6h,0FFF6h
  577.     dw    0FFF6h,0FFF6h,0FFF6h,0FFF7h,0FFF7h
  578.     dw    0FFF7h,0FFF7h,0FFF7h,0FFF8h,0FFF8h
  579.     dw    0FFF8h,0FFF8h,0FFF8h,0FFF9h,0FFF9h
  580.     dw    0FFF9h,0FFF9h,0FFF9h,0FFF9h,0FFFAh
  581.     dw    0FFFAh,0FFFAh,0FFFAh,0FFFAh,0FFFBh
  582.     dw    0FFFBh,0FFFBh,0FFFBh,0FFFBh,0FFFCh
  583.     dw    0FFFCh,0FFFCh,0FFFCh,0FFFCh,0FFFDh
  584.     dw    0FFFDh,0FFFDh,0FFFDh,0FFFDh,0FFFEh
  585.     dw    0FFFEh,0FFFEh,0FFFEh,0FFFEh,0FFFFh
  586.     dw    0FFFFh,0FFFFh,0FFFFh,0FFFFh,00h
  587.     dw    00h,00h,00h,00h,00h
  588.  
  589.  
  590. endtext    LABEL BYTE ;endansi... well... endansiline (numbers are colors)
  591.     db    15
  592.     db    '(c) Paul Geary (Gor)'
  593.     db    3,' ── ',11
  594.     db    'The Flag - in 80386+ Assembler'
  595.     db    3,' ── ',15
  596.     db    '1/2/94'
  597.     db    31
  598. endtext1 LABEL BYTE
  599.  
  600. db 0fch
  601.  
  602. ;████████████████ Uninitialized (zero) data ████████████████
  603.  
  604. zerobeg    LABEL WORD ;start zero clear from here
  605.  
  606. rows    dw    320 dup(0)    ;offsets to screen rows
  607. cols    dw    320 dup(0)    ;offsets to screen cols
  608. colb    db    320 dup(0,0)    ;bitmasks for screen cols
  609.  
  610. ALIGN 4
  611. vbuf    LABEL BYTE
  612.     db    44*200 dup(0) ;video buffer
  613.  
  614. ALIGN 4
  615. dots    LABEL WORD
  616.  
  617. scrollsubber dw    0
  618. framecounter dw    0
  619. oldint8    dd    0
  620.  
  621. zeroend    LABEL WORD ;end zero clear here
  622.  
  623. code     ENDS
  624.     END start
  625.